package com.edu.poli.persistence.practica.remotecliente;

import com.edu.poli.persistence.jpql.ces4j2ee.model.Clientes;
import com.edu.poli.persistence.practica.remoteinterfaces.ClienteController;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 * Hello world!
 *
 */
public class App {

    public static void main(String[] args) throws NamingException {
        Hashtable properties = new Hashtable();
        properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");
        properties.put(Context.URL_PKG_PREFIXES, "com.sun.enterprise.naming");
        properties.put(Context.STATE_FACTORIES, "com.sun.corba.ee.impl.presentation.rmi.JDNIStateFactoryImpl");
        properties.put("org.omg.CORBA.ORBInitialHost", "localhost");
        properties.put("org.omg.CORBA.ORBInitialPort", "3700");
        Context context = new InitialContext(properties);
        ClienteController controller = (ClienteController) context.lookup("java:global/ejb/entrerprise/Customer");
        controller.consultarCliente(new Clientes("1017"));
    }
}
